import pino from "pino";
import config from "../config.js";


const logger = pino({
  level: config.logLevel,  // 设置日志级别
  timestamp: pino.stdTimeFunctions.isoTime,
  // transport: {
  //   target: 'pino-pretty'
  // }
});

// 替换原生 console 方法
console.log = logger.info.bind(logger);
console.info = logger.info.bind(logger);
console.warn = logger.warn.bind(logger);
console.error = logger.error.bind(logger);
console.debug = logger.debug.bind(logger);
